package com.project.server.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

@Data
@TableName("order_detail")
@Schema(description = "订单明细")
public class OrderDetail {

    @TableId(type = IdType.AUTO)
    @Schema(description = "ID")
    private Long id;

    @Schema(description = "订单ID")
    private Long orderId;

    @Schema(description = "菜品ID")
    private Long dishId;

    @Schema(description = "菜品名称")
    @TableField(exist = false)
    private String dishName;

    @Schema(description = "菜品图片")
    @TableField(exist = false)
    private String dishImage;

    @Schema(description = "数量")
    private Integer quantity;

    @Schema(description = "单价")
    private BigDecimal price;

    @Schema(description = "小计")
    private BigDecimal subtotal;
}
